/**
 * @Author: HaoyangDu
 * @Email: HaoyangDu@wits.com
 * @Date: 2024-04-08 18:06:34
 * @LastEditTime: 2024-04-15 10:18:02
 * @LastEditors: your name
 * @Description: 各个接口的网络请求
 * @FilePath: \hfxed\src\utils\http.js
 */
import { networkpost } from "./service";
import api from "./api";

/**
 * @description: 人脸核身
 * @param {*} params
 * @return {*}
 */
export const faceAuth = (params) => {
  let url = api.faceAuth;
  return networkpost(url, params);
};

/**
 * @description: 人脸核身结果
 * @param {*} params
 * @return {*}
 */
export const faceResult = (params) => {
  let url = api.faceResult;
  return networkpost(url, params);
};

/**
 * @description: 客户实名认证
 * @param {*} params
 * @return {*}
 */
export const realNameAuth = (params) => {
  let url = api.realNameAuth;
  return networkpost(url, params);
};

/**
 * @description: 客户实名提交
 * @param {*} params
 * @return {*}
 */
export const realNameSubmit = (params) => {
  let url = api.realNameSubmit;
  return networkpost(url, params);
};

/**
 * @description: 申请详情
 * @param {*} params
 * @return {*}
 */
export const applyDetail = (params) => {
  let url = api.applyDetail;
  return networkpost(url, params);
};

/**
 * @description: 联系我们
 * @param {*} params
 * @return {*}
 */
export const contactWe = (params) => {
  let url = api.contactWe;
  return networkpost(url, params);
};

/**
 * @description: 面谈承诺书
 * @param {*} params
 * @return {*}
 */
export const interview = (params) => {
  let url = api.interview;
  return networkpost(url, params);
};

/**
 * @description: 面谈承诺书预览
 * @param {*} params
 * @return {*}
 */
export const interviewPreview = (params) => {
  let url = api.interviewPreview;
  return networkpost(url, params);
};

/**
 * @description: 面谈承诺书签署
 * @param {*} params
 * @return {*}
 */
export const interviewSign = (params) => {
  let url = api.interviewSign;
  return networkpost(url, params);
};

/**
 * @description: 借款合同预览
 * @param {*} params
 * @return {*}
 */
export const loanContractPreview = (params) => {
  let url = api.loanContractPreview;
  return networkpost(url, params);
};

/**
 * @description: 借款合同签署
 * @param {*} params
 * @return {*}
 */
export const loanContractSign = (params) => {
  let url = api.loanContractSign;
  return networkpost(url, params);
};

/**
 * @description: 我的申请
 * @param {*} params
 * @return {*}
 */
export const myApply = (params) => {
  let url = api.myApply;
  return networkpost(url, params);
};

/**
 * @description: 我的待办
 * @param {*} params
 * @return {*}
 */
export const myCommission = (params) => {
  let url = api.myCommission;
  return networkpost(url, params);
};

/**
 * @description: 我的贷款
 * @param {*} params
 * @return {*}
 */
export const myLoan = (params) => {
  let url = api.myLoan;
  return networkpost(url, params);
};

/**
 * @description: 客户手机换绑
 * @param {*} params
 * @return {*}
 */
export const phoneExchangeBind = (params) => {
  let url = api.phoneExchangeBind;
  return networkpost(url, params);
};

/**
 * @description: 签约信息
 * @param {*} params
 * @return {*}
 */
export const signMessage = (params) => {
  let url = api.signMessage;
  return networkpost(url, params);
};

/**
 * @description: 客户登录
 * @param {*} params
 * @return {*}
 */
export const login = (params) => {
  let url = api.login;
  return networkpost(url, params);
};

/**
 * @description: 发送短信验证码
 * @param {*} params
 * @return {*}
 */
export const sendSmsCode = (params) => {
  let url = api.sendSmsCode;
  return networkpost(url, params);
};

/**
 * @description: 创建客户详细
 * @param {*} params
 * @return {*}
 */
export const createCd = (params) => {
  let url = api.createCd;
  return networkpost(url, params);
};

/**
 * @description: 创建订单
 * @param {*} params
 * @return {*}
 */
export const createOrder = (params, header) => {
  let url = api.createOrder;
  return networkpost(url, params, header);
};

/**
 * @description: 创建订单执行记录
 * @param {*} params
 * @return {*}
 */
export const createOrderExecRcd = (params) => {
  let url = api.createOrderExecRcd;
  return networkpost(url, params);
};

/**
 * @description: 创建参与人
 * @param {*} params
 * @return {*}
 */
export const createPlayers = (params) => {
  let url = api.createPlayers;
  return networkpost(url, params);
};

/**
 * @description: 创建参与人详细
 * @param {*} params
 * @return {*}
 */
export const createPlayersDetail = (params) => {
  let url = api.createPlayersDetail;
  return networkpost(url, params);
};

/**
 * @description: 授信申请
 * @param {*} params
 * @return {*}
 */
export const creditApply = (params) => {
  let url = api.creditApply;
  return networkpost(url, params);
};

/**
 * @description: 征信授权书预览
 * @param {*} params
 * @return {*}
 */
export const creditAuthBookPreview = (params) => {
  let url = api.creditAuthBookPreview;
  return networkpost(url, params);
};

/**
 * @description: 授信结果查询
 * @param {*} params
 * @return {*}
 */
export const creditResult = (params) => {
  let url = api.creditResult;
  return networkpost(url, params);
};

/**
 * @description: 个人敏感信息收集及使用授权书预览
 * @param {*} params
 * @return {*}
 */
export const personSensitiveMsgPreview = (params) => {
  let url = api.personSensitiveMsgPreview;
  return networkpost(url, params);
};

/**
 * @description: 选择网点
 * @param {*} params
 * @return {*}
 */
export const orgChoose = (params) => {
  let url = api.orgChoose;
  return networkpost(url, params);
};

/**
 * @description: 展示用户行径
 * @param {*} params
 * @return {*}
 */
export const show = (params) => {
  let url = api.show;
  return networkpost(url, params);
};

/**
 * @description: 分配客户经理
 * @param {*} params
 * @return {*}
 */
export const allocationCt = (params) => {
  let url = api.allocationCt;
  return networkpost(url, params);
};

/**
 * @description: 获取图片验证码
 * @param {*} params
 * @return {*}
 */
export const kaptcha = (params) => {
  let url = api.kaptcha;
  return networkpost(url, params);
};

/**
 * @description: 获取openid
 * @param {*} params
 * @return {*}
 */
export const getOpenId = (params) => {
  let url = api.getOpenid;
  return networkpost(url, params);
};

/**
 * @description: 文件预览
 * @param {*} params
 * @return {*}
 */
export const viewFile = (params) => {
  let url = api.viewFile;
  return networkpost(url, params);
};

/**
 * @description: 链接授权
 * @param {*} params
 * @return {*}
 */
export const linkAuth = (params) => {
  let url = api.linkAuth;
  return networkpost(url, params);
};

/**
 * @description: 获取微信code
 * @return {*}  code
 */
export const getWxCode = () => {
  return new Promise((resolve, reject) => {
    wx.login({
      success: (res) => {
        resolve(res.code);
      },
      fail: (err) => {
        reject(err);
      },
    });
  });
};
